<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		数字1:<input type="text" id="number1" value="" />
		<select id="all">
			<option value="+" >+</option>
			<option value="-" >-</option>
			<option value="*" >*</option>
			<option value="/" >/</option>
		</select>
		数字2:<input type="text" id="number2" value="" />
		<button type="button" onclick="result()">提交</button>
		结果:<input type="text" id="endresult" value="" />
	</body>
	<script type="text/javascript">
		function result(){
			var num=0;
			var num1 = parseFloat(document.getElementById('number1').value)
			var num2 = parseFloat(document.getElementById('number2').value)
			var four = document.getElementById('all').value;
			  if(four =='+'){
				num =num1+num2
			} if(four == '-'){
				num = num1-num2
			} if(four == '*'){
				num = num1*num2
			} if(four == '/'){
				num = num1/num2
			}
			document.getElementById('endresult').value = num;
		}
	</script>
</html>
